<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>电子处方界面</title>
    <link rel="stylesheet" href="../css/perscription.css">
    <script src="../js/jquery.js"></script>
    <script src="../js/perscription.js"></script>
</head>
<body>
<!--电子处方操作界面-->
<div class="perscriptionOper">
    <button id="perscriptionOperAddBtn">新添加处方</button>
</div>
<hr/>
<!--历史处方显示-->
<div class="perscriptionInformation">
    <table id="tb_perscrition" cellspacing="0" cellpadding="2" width="100%" border="1">
        <tr align="center" bgcolor="#dcdcdc">
            <td style="width:100px;">编号</td>
            <td>病人姓名</td>
            <td>日期</td>
            <td>患者自述</td>
            <td>检查部位</td>
            <td>诊断结果</td>
            <td>所开药物</td>
            <td>诊断医师</td>
            <td>操作</td>
        </tr>
        <!--<tr>-->
            <!--<td style="width:100px;">1</td>-->
            <!--<td>张三</td>-->
            <!--<td>2019/01/09</td>-->
            <!--<td>头疼</td>-->
            <!--<td>头部</td>-->
            <!--<td>着凉</td>-->
            <!--<td>阿司匹林一盒，退烧药六份，一日三次</td>-->
            <!--<td>吴医生</td>-->
            <!--<td>-->
                <!--<button data-id="" class="perscriptionInformationShowUpdateBtn">编辑</button>-->
                <!--<button data-id="" class="perscriptionInformationShowCancelBtn">删除</button>-->
            <!--</td>-->
        <!--</tr>-->
    </table>
</div>
<!--添加信息界面-->
<div class="perscriptionAdd">
    <div>
        <label for="perscriptionAddInputName">病人姓名</label>
        <input class="perscriptionAddInput" id="perscriptionAddInputName" placeholder="请输入姓名">
        <span id="judgeName"></span>
    </div>
    <div>
        <label for="perscriptionAddInputDate">看病日期</label>
        <input class="perscriptionAddInput" type="date" id="perscriptionAddInputDate" placeholder="请选择日期">
        <span id="judgeDate"></span>
    </div>
    <div>
        <label for="perscriptionAddInputDescription">患者自述</label>
        <input class="perscriptionAddInput" id="perscriptionAddInputDescription" placeholder="请输入患者自述（可空）">
        <span id="judgeDesc"></span>
    </div>
    <div>
        <label for="perscriptionAddInputPoint">检查部位</label>
        <input class="perscriptionAddInput" id="perscriptionAddInputPoint" placeholder="请输入检查部位（可空）">
    </div>
    <div>
        <label for="perscriptionAddInputResult">诊断结果</label>
        <input class="perscriptionAddInput" id="perscriptionAddInputResult" placeholder="请输入诊断结果（可空）">
    </div>
    <div>
        <label for="perscriptionAddInputAdvice">医师建议</label>
        <input class="perscriptionAddInput" id="perscriptionAddInputAdvice" placeholder="请输入所开药物（可空）">
    </div>
    <div>
        <label for="perscriptionAddInputPerson">诊断医师</label>
        <input class="perscriptionAddInput" id="perscriptionAddInputPerson" placeholder="请输入诊断医师（可空）">
    </div>
    <div>
        <button id="perscriptionAddSureBtn">确认</button>
        <button id="perscriptionAddBackBtn">返回</button>
    </div>
</div>
<!--编辑框弹出界面-->
<div class="perscroptionClickUpdateGetInfo">
    <div>
        <label for="perscriptionName">病人姓名</label>
        <input type="text" class="perscription" id="perscriptionName" placeholder="">
    </div>
    <div>
        <label for="perscriptionDate">看病日期</label>
        <input type="text" class="perscription" id="perscriptionDate" placeholder="">
    </div>
    <div>
        <label for="perscriptionDescription">患者自述</label>
        <input type="text" class="perscription" id="perscriptionDescription" placeholder="">
    </div>
    <div>
        <label for="perscriptionPoint">检查部位</label>
        <input type="text" class="perscription" id="perscriptionPoint" placeholder="">
    </div>
    <div>
        <label for="perscriptionResult">检查结果</label>
        <input type="text" class="perscription" id="perscriptionResult" placeholder="">
    </div>
    <div>
        <label for="perscriptionMdc">所开药物</label>
        <input type="text" class="perscription" id="perscriptionMdc" placeholder="">
    </div>
    <div>
        <label for="perscriptionPerson">诊断医师</label>
        <input type="text" class="perscription" id="perscriptionPerson" placeholder="">
    </div>
    <div>
        <button id="perscriptionclickUpdateGetInfoSureBtn">确认</button>
        <button id="perscriptionclickUpdateGetInfoBackBtn">返回</button>
    </div>
</div>
<div id="over"></div>
<!--表格宽度可伸缩事件-->
<script type="text/javascript">
    var tTD; //用来存储当前更改宽度的Table Cell,避免快速移动鼠标的问题
    var table = document.getElementById("tb_perscription");
    for (j = 0; j < table.rows[0].cells.length; j++) {
        table.rows[0].cells[j].onmousedown = function () {
//记录单元格
            tTD = this;
            if (event.offsetX > tTD.offsetWidth - 10) {
                tTD.mouseDown = true;
                tTD.oldX = event.x;
                tTD.oldWidth = tTD.offsetWidth;
            }
//记录Table宽度
//table = tTD; while (table.tagName != ‘TABLE') table = table.parentElement;
//tTD.tableWidth = table.offsetWidth;
        };
        table.rows[0].cells[j].onmouseup = function () {
//结束宽度调整
            if (tTD == undefined) tTD = this;
            tTD.mouseDown = false;
            tTD.style.cursor = 'default';
        };
        table.rows[0].cells[j].onmousemove = function () {
//更改鼠标样式
            if (event.offsetX > this.offsetWidth - 10)
                this.style.cursor = 'col-resize';
            else
                this.style.cursor = 'default';
//取出暂存的Table Cell
            if (tTD == undefined) tTD = this;
//调整宽度
            if (tTD.mouseDown != null && tTD.mouseDown == true) {
                tTD.style.cursor = 'default';
                if (tTD.oldWidth + (event.x - tTD.oldX) > 0)
                    tTD.width = tTD.oldWidth + (event.x - tTD.oldX);
//调整列宽
                tTD.style.width = tTD.width;
                tTD.style.cursor = 'col-resize';
//调整该列中的每个Cell
                table = tTD;
                while (table.tagName != 'TABLE') table = table.parentElement;
                for (j = 0; j < table.rows.length; j++) {
                    table.rows[j].cells[tTD.cellIndex].width = tTD.width;
                }
//调整整个表
//table.width = tTD.tableWidth + (tTD.offsetWidth – tTD.oldWidth);
//table.style.width = table.width;
            }
        };
    }
</script>
</body>
</html>